//
//  LFUser.swift
//  SDAutoWeibo
//
//  Created by 刘健 on 16/3/25.
//  Copyright © 2016年 Clemmie. All rights reserved.
//

import UIKit

class LFUser: NSObject {
    
    /// 字符串型的用户UID
    var idstr: String?
    
    /// 友好显示名称
    var name: String?
    
    /// 用户头像地址（中图），50×50像素
    var profile_image_url: String?
    
    
    /// verified_type 没有认证:-1   认证用户:0  企业认证:2,3,5  达人:220
    var verified_type: Int = -1 {
        didSet {
            switch verified_type {
            case 0:
               verifiedImage = UIImage(named: "avatar_vip")
            case 2,3,5:
                verifiedImage = UIImage(named: "avatar_enterprise_vip")
            case 220:
                verifiedImage = UIImage(named: "avatar_grassroot")
            default:
                //在cell里面 防止重用
                verifiedImage = nil
            }
        }
    }
   
    var verifiedImage :UIImage?
  
    /// 会员等级 1-6
    var mbrank: Int = 0 {
        didSet {
            if mbrank >= 1 && mbrank <= 6 {
                mbrankImage = UIImage(named: "common_icon_membership_level\(mbrank)")
            }else {
                 mbrankImage = UIImage(named:"common_icon_membership_expired")
            }
        }
    }
    
    
    var mbrankImage: UIImage?


    init(dict: [String : AnyObject]) {
        super.init()
        setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
}
